barplot

instacart %>%
  count(department) %>%
  mutate(department = fct_reorder(department, n)) %>%
  plot_ly(x = ~department, y = ~n, color = ~department, type = "bar")
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors

boxplot

instacart %>%
  mutate(departnemt = fct_reorder(department, order_hour_of_day)) %>%
  plot_ly(x = ~department, y = ~order_hour_of_day, color = ~department, type = "box")
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors

scatterplot

instacart %>%
  filter(order_dow == "4") %>%
  filter(user_id < 10000) %>%
  plot_ly(x = ~department, y = ~order_hour_of_day, color = ~department, type = "scatter", alpha = 0.1)
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors